package com.lintesis.lintesisview.common.util;

import org.zkoss.util.resource.Labels;


public class ErrorMessageMapper
{
	public static String getMessage(Exception ex)
	{
		if(ex.getCause()==null)
			return Labels.getLabel("error.unknown")+" "+ex.getMessage();
		if(ex.getCause().toString().contains("ORA-00001"))
			return Labels.getLabel("error.uniqueKeyViolated");
		return Labels.getLabel("error.unknown")+" "+ex.getMessage()+" "+ex.getCause();
	}
}
